jQuery(document).ready(function() {
	
});

function music_add(){
	window.location = SITE_URL+'admin/dataman/general/music_add';
}

function music_save(){
	jQuery.post(SITE_URL+'admin/dataman/general/music_save',{id:jQuery('#music_id').val(),name:jQuery('#name').val()},function(res){
		if(res == "OK"){
			window.location = SITE_URL+'admin/dataman/general';
		}else{
			if(jQuery('#music_id').val() != ''){
				window.location = SITE_URL+'admin/dataman/general/music_edit/'+jQuery('#music_id').val();
			}else{
				window.location = SITE_URL+'admin/dataman/general/music_add/';
			}	
		}
	});
}

function country_add(){
	window.location = SITE_URL+'admin/dataman/general/country_add';
}

function country_save(){
	jQuery.post(SITE_URL+'admin/dataman/general/country_save',{id:jQuery('#country_id').val(),name:jQuery('#name').val(),code:jQuery('#code').val(),country_origin_code:jQuery('#country_origin_code').val()},function(res){
		if(res == "OK"){
			window.location = SITE_URL+'admin/dataman/general/country';
		}else{
			if(jQuery('#country_id').val() != ''){
				window.location = SITE_URL+'admin/dataman/general/country_edit/'+ jQuery('#country_id').val();
			}else{
				window.location = SITE_URL+'admin/dataman/general/country_add/';
			}	
		}
	});
}

function city_add(){
	window.location = SITE_URL+'admin/dataman/general/city_add';
}

function city_save(){
	jQuery.post(SITE_URL+'admin/dataman/general/city_save',{id:jQuery('#city_id').val(),name:jQuery('#name').val(),code:jQuery('#code').val(),country_id:jQuery('#country_id').val()},function(res){
		if(res == "OK"){
			window.location = SITE_URL+'admin/dataman/general/city';
		}else{
			if(jQuery('#city_id').val() != ''){
				window.location = SITE_URL+'admin/dataman/general/city_edit/'+ jQuery('#city_id').val();
			}else{
				window.location = SITE_URL+'admin/dataman/general/city_add/';
			}	
		}
	});	
}

